package com.boco.pciv.service.project.impl;

import com.boco.pciv.core.service.PcivBaseServiceImpl;
import com.boco.pciv.entity.project.ProjectInfo;
import com.boco.pciv.entity.project.RecordInfo;
import com.boco.pciv.entity.sale.SaleInfo;
import com.boco.pciv.mapper.project.IRecordMapper;
import com.boco.pciv.service.project.IRecordService;
import org.springframework.stereotype.Service;

/**
 * Created by sunrise on 2020/7/16.
 */
@Service
public class RecordServiceImpl extends PcivBaseServiceImpl<IRecordMapper,RecordInfo,Integer> implements IRecordService {

    public void projectRecord(ProjectInfo info,Integer status,String user) {
        RecordInfo record = new RecordInfo();
        record.setCheckType(0);
//        record.setProjectId(info.getProjectId());
//        record.setProjectName(info.getProjectName());
//        record.setLicno(info.getLicno());
//        record.setCompanyName(info.getCompanyName());
        record.setStatus(status);
        record.setUname(user);
        mapper.insert(record);
    }

    public void saleRecord(SaleInfo info ,Integer status,String user) {
        RecordInfo record = new RecordInfo();
        record.setCheckType(1);
        record.setProjectId(info.getProjectId());
        record.setProjectName(info.getProjectName());
        record.setLicno(info.getLicno());
        record.setCompanyName(info.getCompanyName());
        record.setStatus(status);
        record.setUname(user);
        record.setSaleNo(info.getSaleNo());
        record.setSaleName(info.getSaleName());
        mapper.insert(record);
    }

}
